<?php
include "includes/db.php";
$mysqli = new MossCMS();
if ($_POST["username"] != "" && $_POST["password"] != "") {

	$login_response = $mysqli->login($_POST["username"], $_POST["password"]);
	print_r($login_response);
	if($login_response[0] == 0){
		$mysqli->logins_log($_POST["username"]);
		$_SESSION[$prefix.'_username'] = $_POST["username"];
		$_SESSION[$prefix.'_security'] = $login_response[1];
		$_SESSION[$prefix.'_groups'] 	= $login_response[2];
		header("location:index.php");exit;
	}
	else{$loginF = "You are not approved to access this site";}

	}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Moss, Inc - Portal</title>
<link href="includes/sw_orig.css" rel="stylesheet" type="text/css" media="screen" />
<link href="includes/local.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="container">
  <div id="header">
		<?php include "includes/header.php"; ?>	 
	</div>


<div id="mainContent" class="frontpage">
<h1>Login to Continue</h1>
<FORM METHOD="POST" ACTION="" >

								<p>Username: <input type="text" id="username" name="username" autofocus required  /></p>
								<p>Password: <input type="password" id="password" name="password" required /></p>
								
								<input type="submit" value="Login" title="Login">
						</form>	
            
		<div class="clear"></div>	

 
<div id="footer">
	<?php include "includes/footer.php"; ?>
</div>
<!-- end #container --></div>

<br />
</body>
</html>
